﻿<UserControl x:Class="Dsl.Ped.Desktop.Views.RibbonBarView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
             xmlns:framework="clr-namespace:Dsl.Ped.Framework.Resources;assembly=DslPedFramework"
             xmlns:resources="clr-namespace:Dsl.Ped.Desktop.Resources"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <ribbon:Ribbon x:Name="Ribbon" Grid.Row="0">
        <ribbon:Ribbon.ApplicationMenu>
            <ribbon:RibbonApplicationMenu Visibility="Collapsed" Loaded="Ribbon_Loaded">
            </ribbon:RibbonApplicationMenu>
        </ribbon:Ribbon.ApplicationMenu>

        <ribbon:RibbonTab x:Name="FileTab"
                          Header="File">
            <ribbon:RibbonGroup Header="Open and Save"
                                ItemsSource="{Binding Path=ApplicationCommands}">
                <ribbon:RibbonGroup.ItemTemplate>
                    <DataTemplate>
                        <ribbon:RibbonControl>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ribbon:RibbonButton Grid.Row="0"    
                                                     Label="{Binding Title}"
                                                     LargeImageSource="{Binding LargeImageSource}"
                                                     Command="{Binding Command}">
                                </ribbon:RibbonButton>
                            </Grid>
                        </ribbon:RibbonControl>
                    </DataTemplate>
                </ribbon:RibbonGroup.ItemTemplate>
            </ribbon:RibbonGroup>

            <ribbon:RibbonGroup Header="New"
                                ItemsSource="{Binding Path=AddIns}">
                <ribbon:RibbonGroup.ItemTemplate>
                    <DataTemplate>
                        <ribbon:RibbonControl>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ribbon:RibbonButton Grid.Row="0"    
                                                     Label="{Binding Title}"
                                                     LargeImageSource="{Binding LargeImageSource}"
                                                     Command="{Binding Command}"
                                                     CommandParameter="{Binding CommandParameter}">
                                </ribbon:RibbonButton>
                            </Grid>
                        </ribbon:RibbonControl>
                    </DataTemplate>
                </ribbon:RibbonGroup.ItemTemplate>
            </ribbon:RibbonGroup>
        </ribbon:RibbonTab>
        
        <ribbon:RibbonTab x:Name="ViewTab" 
                          Header="View">
            <ribbon:RibbonGroup x:Name="Modules" 
                                Header="Modules"
                                ItemsSource="{Binding Path=Modules}">
                <ribbon:RibbonGroup.ItemTemplate>
                    <DataTemplate>
                        <ribbon:RibbonControl>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ribbon:RibbonButton Grid.Row="0"    
                                                     Label="{Binding Title}"
                                                     LargeImageSource="{Binding LargeImageSource}"
                                                     Command="{Binding OpenModuleCommand}"
                                                     CommandParameter="{Binding ModuleName}">
                                </ribbon:RibbonButton>
                            </Grid>
                        </ribbon:RibbonControl>
                    </DataTemplate>
                </ribbon:RibbonGroup.ItemTemplate>
            </ribbon:RibbonGroup>

            <ribbon:RibbonGroup Header="{x:Static resources:DesktopLang.About}">
                <ribbon:RibbonButton 
                            LargeImageSource="pack://application:,,,/DSLPedDesktop;component/Resources/Images/about_32.png"
                            Label="{x:Static resources:DesktopLang.About}"
                            Command="{Binding Path=AboutCommand}">
                </ribbon:RibbonButton>
            </ribbon:RibbonGroup>
        </ribbon:RibbonTab>
    </ribbon:Ribbon>
</UserControl>
